package cn.bellychang.ood.litejunit.v2.biz;

import cn.bellychang.ood.litejunit.v2.framework.TestSuite;
import cn.bellychang.ood.litejunit.v2.framework.decorator.OverallTestSetup;
import cn.bellychang.ood.litejunit.v2.framework.decorator.RepeatedTest;
import cn.bellychang.ood.litejunit.v2.biz.calculator.CalculatorSuite;
import cn.bellychang.ood.litejunit.v2.biz.person.PersonTest;
import cn.bellychang.ood.litejunit.v2.framework.Test;

/**
 * @author ChangLiang
 * @date 2020/5/27
 */
public class AllTestSuiteV2 {

    public static Test suite() {
        TestSuite allTestSuite = new TestSuite("All Test");

        // 通过这种方式维护好TestSuite->...->TestSuite->TestCase这个关联关系
        allTestSuite.addTest(CalculatorSuite.suite());
        // 装饰模式，装饰的都是TestSuite
        allTestSuite.addTest(new RepeatedTest(new TestSuite(PersonTest.class),2));

        return new OverallTestSetup(allTestSuite);
    }
}
